﻿using System;
using System.Net;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CrazyBubbleToolkit
{
    public class QueryStringBuilder : Dictionary<string, string>
    {
        public string ToQueryString(bool startWithQueryMark = true)
        {
            return startWithQueryMark ? "?" : "" + String.Join("&", this.Select(kvp => String.Format("{0}={1}", HttpUtility.UrlEncode(kvp.Key), HttpUtility.UrlEncode(kvp.Value))).ToArray());
        }
    }
}
